<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStudentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('students', function (Blueprint $table) {
            $table->increments('id');
            $table->string('openid',50)->unique();
            $table->string('name');
            $table->string('school',50)->index();
            $table->string('faculty')->nullable()->comment('院系');
            $table->string('profession')->nullable()->comment('专业');
            $table->string('studentID')->nullable()->comment('学号');
            $table->string('graduation_time')->nullable()->comment('毕业时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('schools');
    }
}
